package com.ktmall.ktmalluijava.mapper;

import com.ktmall.ktmalluijava.pojo.Order;
import com.ktmall.ktmalluijava.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ZhouShuang
 * @version 17
 * @Title
 * @date 2025/5/20 上午8:42
 */
@Mapper
public interface OrderMapper {

    /**
     * 获取分页数据
     * @param orderSn
     * @param userId
     * @param orderState
     * @return
     */
    List<OrderVO> select(@Param("orderSn") String orderSn, @Param("userId") Integer userId, @Param("orderState") Integer orderState,@Param("offset") Integer offset,@Param("pageSize") Integer pageSize);

    /**
     * 详情
     * @param id
     * @return
     */
    Order detail(Integer id);

    /**
     * 详情
     * @param order
     * @return
     */
    int update(Order order);

    /**
     * 删除
     * @param id
     * @return
     */
    int delete(Integer id);

    /**
     * 获取总记录数
     * @param orderSn
     * @param userId
     * @param orderState
     * @return
     */
    int count(@Param("orderSn") String orderSn, @Param("userId") Integer userId, @Param("orderState") Integer orderState);

    /**
     * 获取单个
     * @param id
     * @return
     */
    OrderVO findById(Integer id);
}
